<template>
  <div class="header">
    <img :src="info.cover" class="bg-img">
    <div class="bg-shadow" />
    <div class="header__main">
      <div class="header__main-left">
        <div class="img">
          <el-image
            :src="info.cover"
            style="width: 100%; height: 100%;"
            fit="cover"
          />
        </div>
      </div>
      <div class="header__main-right">
        <div class="title">{{ info.title }}</div>

        <div class="details">
          <div
            class="details__item"
          >
            <svg-icon icon-class="learning_cycle" class-name="details__item-icon" />
            <div class="details__item-info">
              <div class="details__item-info__title">学习周期：</div>
              <div class="details__item-info__content">{{ info?.day }}天</div>
            </div>
          </div>

          <div
            class="details__item"
          >
            <svg-icon icon-class="video_duration" class-name="details__item-icon" />
            <div class="details__item-info">
              <div class="details__item-info__title">视频总时长：</div>
              <div class="details__item-info__content">{{ info?.duration }}</div>
            </div>
          </div>
        </div>

        <div class="details">
          <div
            class="details__item"
          >
            <svg-icon icon-class="chapter_num" class-name="details__item-icon" />
            <div class="details__item-info">
              <div class="details__item-info__title">章节数：</div>
              <div class="details__item-info__content">{{ info?.chapter?.length }}章</div>
            </div>
          </div>

          <div
            class="details__item"
          >
            <svg-icon icon-class="create_time" class-name="details__item-icon" />
            <div class="details__item-info">
              <div class="details__item-info__title">创建时间：</div>
              <div class="details__item-info__content">{{ info?.created_at }}</div>
            </div>
          </div>
        </div>

      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: '',
  props: {
    info: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {

    }
  },
  computed: {
    details() {
      return [
        { title: '学习周期：', icon: 'learning_cycle', data: this.info?.day, unit: '天' },
        { title: '视频总时长：', icon: 'video_duration', data: this.info?.duration, unit: '' },
        { title: '章节数：', icon: 'chapter_num', data: this.info?.chapter?.length, unit: '章' },
        { title: '创建时间：', icon: 'create_time', data: this.info?.created_at, unit: '' }
      ]
    }
  }
}
</script>
<style lang="scss" scoped>
* {
  font-family: Microsoft YaHei, Microsoft YaHei;
}
.header {
  position: relative;
  overflow: hidden;
  height: 280px;
  .bg-img {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    filter: blur(30px);
  }
  .bg-shadow {
    position: absolute;
    top: 0;
    left: 0;
    background-color: #000;
    opacity: .6;
    height: 100%;
    width: 100%;
    z-index: 2;
  }
  &__main {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 3;
    width: 100%;
    display: flex;
    //justify-content: center;
    padding-left: 402px;
    align-items: center;
    &-left,&-right {
      height: 200px;
    }
    &-left {
      width: 360px;
      height: 240px;
      overflow: hidden;
      border-radius: 5px;
      margin-right: 36px;
      .img {
        width: 100%;
        height: 100%;
      }
    }

    &-right {
      color: #fff;
      .title {
        font-size: 24px;
        margin-bottom: 58px;
      }

      .details {
        display: flex;
        &__item {
          margin-bottom: 32px;
          display: flex;
          align-items: center;

          &-icon {
            font-size: 32px;
          }

          &-info {
            margin-left: 12px;
            margin-right: 20px;

            &__title {
              font-size: 14px;
              min-width: 84px;
            }

            &__content {
              margin-top: 10px;
              font-size: 16px;
            }
          }

        }
      }
      ul {
        list-style: none;
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        padding: 0;
        margin: 0;
        font-size: 14px;
        li {
          width: 49%;
          margin: 10px 0 0 0;
        }
      }
    }
  }

}
</style>
